﻿@model CID.Web.Models.Development.VersionViewModel

<div id="Tabs">
    <ul>
        <li><a href="#General">General</a></li>
        <li><a href="#Packages">Packages</a></li>
        <li><a href="#Dependencies">Dependencies</a></li>
        <li><a href="#DeploymentParameters">Deployment Parameters</a></li>
    </ul>
    <div id="General">
        <div class="display-label">Name</div>
        <div class="display-field">
            @Html.DisplayFor(m => m.Name)
        </div>

        <div class="display-label">Description</div>
        <div class="display-field">
            @Html.DisplayFor(m => m.Description)
        </div>

        <div class="display-label">@Html.LabelFor(m => m.Release)</div>
        <div class="display-field">
            @Html.DisplayFor(m => m.Release)
        </div>

        <div class="display-label">@Html.LabelFor(m => m.DeploymentTemplate)</div>
        <div class="display-field">
            @Html.DisplayFor(m => m.DeploymentTemplate)
        </div>
    </div>

    <div id="Packages">
        <div class="display-field">
            <table>
                <thead>
                    <tr>
                        <th>Type</th>
                        <th>Comment</th>
                        <th>Is Active</th>
                    </tr>
                </thead>
                <tbody>
                @foreach (var item in Model.Packages)
                {
                    <tr>
                        <td>@Html.DisplayFor(m => item.PackageType)</td>
                        <td>@Html.DisplayFor(m => item.Comment)</td>
                        <td>@Html.DisplayFor(m => item.IsActive)</td>
                    </tr>
                }
                </tbody>
            </table>
        </div>
    </div>
   
    <div id="Dependencies">
        <div class="display-field">
            <table>
                <thead>
                    <tr>
                        <th>Component</th>
                    </tr>
                </thead>
                <tbody>
                @foreach (var item in Model.DependsOn)
                {
                    <tr>
                        <td>@Html.DisplayFor(m => item.Name)</td>
                    </tr>
                }
                </tbody>
            </table>
        </div>
    </div>
   
    <div id="DeploymentParameters">
        <div class="display-field">
            <table>
                <thead>
                    <tr>
                        <th>Environment</th>
                        <th>Parameter</th>
                        <th>Type</th>
                        <th>Value</th>
                    </tr>
                </thead>
                <tbody>
                @foreach (var item in Model.DeploymentParameterValues.OrderBy(x => Math.Sign(x.ParameterId)).ThenBy(x => x.Environment).ThenBy(x => x.Parameter))
                {
                    if (item.HasValue)
                    {
                            <tr>
                                <td>@Html.DisplayFor(m => item.Environment)</td>
                                <td>@Html.DisplayFor(m => item.Parameter)</td>
                                <td>@Html.DisplayFor(m => item.ParameterType)</td>
                                <td>@Html.DisplayFor(m => item.DisplayValue)</td>
                            </tr>
                    }
                }
                </tbody>
            </table>
        </div>
    </div>

@Html.HiddenFor(m => m.ComponentId)
@Html.HiddenFor(m => m.Id)
<script type="text/javascript">
    $(document).ready(function () {
        $("#Tabs").tabs();
    });
</script>